home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / game / patch / Viz.lha / VizHD / Install next >
Text File  |  2001-01-01  |  3KB  |  176 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")        ;sub directory containing data files
  4. (set #readme-file "README")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6. (set #last-file "viz.end")    ;last file the imager should create
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; checks if given program is installed, if not abort install
  11. ; #program - to check
  12.  
  13. (procedure P_ChkRun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort
  18.       (cat
  19.     "You must install \"" #program "\" first!\n"
  20.     "It must be accessible via the path.\n"
  21.     "You can find it in the WHDLoad package."
  22.       )
  23.     )
  24.   )
  25. )
  26.  
  27. ;****************************
  28.  
  29. (if
  30.   (exists #readme-file)
  31.   (if
  32.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  33.     ("")
  34.     (run ("SYS:Utilities/More %s" #readme-file))
  35.   )
  36. )
  37.  
  38. (set #program "WHDLoad")
  39. (P_ChkRun)
  40.  
  41. (set #program "RawDIC")
  42. (P_ChkRun)
  43.  
  44. (if
  45.   (= @user-level 2)
  46.   (
  47.     (set #CI_drive
  48.       (askchoice
  49.     (prompt "Select source drive for diskimages")
  50.     (default 0)
  51.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  52.     (help @askchoice-help)
  53.       )
  54.     )
  55.     (select #CI_drive
  56.       (set #CI_drive "DF0:")
  57.       (set #CI_drive "DF1:")
  58.       (set #CI_drive "DF2:")
  59.       (set #CI_drive "DF3:")
  60.     )
  61.     (set #ignore " IGNOREERRORS")
  62.   )
  63.   (set #CI_drive "DF0:")
  64.   (set #ignore "")
  65. )
  66.  
  67. (set @default-dest
  68.   (askdir
  69.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  70.     (help @askdir-help)
  71.     (default @default-dest)
  72.     (disk)
  73.   )
  74. )
  75. (set #dest (tackon @default-dest @app-name))
  76. (if
  77.   (exists #dest)
  78.   (
  79.     (set #choice
  80.       (askbool
  81.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  82.         (default 1)
  83.         (choices "Delete" "Skip")
  84.         (help @askbool-help)
  85.       )
  86.     )
  87.     (if
  88.       (= #choice 1)
  89.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  90.     )
  91.   )
  92. )
  93. (makedir #dest
  94.   (help @makedir-help)
  95.   (infos)
  96. )
  97.  
  98. ;----------------------------
  99.  
  100. (if
  101.   (exists ("%s.newicon" @app-name))
  102.   (set #icon
  103.     (askchoice
  104.       (prompt "\nWhich icon would you like to install?\n")
  105.       (default 0)
  106.       (choices "Normal" "NewIcon" "GlowIcon")
  107.       (help @askchoice-help)
  108.     )
  109.   )
  110.   (set #icon 0)
  111. )
  112. (select #icon
  113.   (set #icon ("%s.inf" @app-name))
  114.   (set #icon ("%s.newicon" @app-name))
  115.   (set #icon ("%s.glowicon" @app-name))
  116. )
  117. (copyfiles
  118.   (help @copyfiles-help)
  119.   (source #icon)
  120.   (newname ("%s.info" @app-name))
  121.   (dest #dest)
  122. )
  123. (copyfiles
  124.   (help @copyfiles-help)
  125.   (source ("%s.Slave" @app-name ))
  126.   (dest #dest)
  127. )
  128. (if
  129.   (exists #readme-file)
  130.   (copyfiles
  131.     (help @copyfiles-help)
  132.     (source #readme-file)
  133.     (dest #dest)
  134.   )
  135. )
  136. (if
  137.   (exists ("%s.info" #readme-file))
  138.   (copyfiles
  139.     (help @copyfiles-help)
  140.     (source ("%s.info" #readme-file))
  141.     (dest #dest)
  142.   )
  143. )
  144.  
  145. (if
  146.   (= #sub-dir "")
  147.   ("")
  148.   (
  149.     (set #dest (tackon #dest #sub-dir))
  150.     (makedir #dest
  151.       (help @makedir-help)
  152.     )
  153.   )
  154. )
  155.  
  156. (copyfiles
  157.   (help @copyfiles-help)
  158.   (source ("%s.islave" @app-name))
  159.   (dest #dest)
  160. )
  161.  
  162. (working)
  163. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave RETRIES=15 SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
  164.  
  165. (if
  166.   (exists (tackon #dest #last-file))
  167.   ("")
  168.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  169. )
  170.  
  171. ;----------------------------
  172.  
  173. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  174.  
  175. (exit)
  176.